package edu.pku.taas.hyperic.types2;

import java.util.List;

import edu.pku.taas.hyperic.monitor.MonitorConstants;
public class Cluster {
	public static String NAME = "Cluster";
	protected String masterIP;
	protected int masterPort;
	private String name;

	protected String masterHostName;
	protected List<PhysicalMachine> physicalMachines;
	
	protected List<PhysicalMachine> children;
	
	private int type=2;
	
	public static final int resourceType = MonitorConstants.RESOURCE_CLUSTER_TYPE;

	public String getMasterIP() {
		return masterIP;
	}

	public void setMasterIP(String masterIP) {
		this.masterIP = masterIP;
	}


	public void setMasterPort(int masterPort) {
		this.masterPort = masterPort;
	}
	

	public int getMasterPort() {
		return masterPort;
	}
	public String getMasterHostName() {
		return masterHostName;
	}

	public void setMasterHostName(String masterHostName) {
		this.masterHostName = masterHostName;
	}

	public List<PhysicalMachine> getPhysicalMachines() {
		return physicalMachines;
	}

	public void setPhysicalMachines(List<PhysicalMachine> physicalMachines) {
		this.physicalMachines = physicalMachines;
		this.children = physicalMachines;
	}

	public Cluster() {
		super();
	}

	public String getName() {
//		return name ;
		return NAME+ "(" +getMasterHostName()+")";
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<PhysicalMachine> getChildren() {
		return children;
	}

	public void setChildren(List<PhysicalMachine> children) {
		this.children = children;
		this.physicalMachines = children;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

}
